package com.xspace.android.xafcommon.network;

public class HttpUtil {
	public static void isLegalHttpUrl(String url) {
		System.out.println(url);
		if (url == null || url.trim().equals("")) {
			throw new IllegalArgumentException(url
					+ " is not an right http url,no ''");
		} else {
			try {
				int idx = url.indexOf("://");
				if (idx == -1) {
					throw new IllegalArgumentException(url
							+ " is not an right http url,no '://'");
				}
				if (!url.startsWith("http")) {
					throw new IllegalArgumentException(url
							+ " is not an right http url,no \"http\"");
				}
			} catch (Exception e) {
				throw new IllegalArgumentException(url + e.getMessage());
			}
		}
	}
}
